package com.czx.config;

import com.czx.interceptor.UserTokenInceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMVCConfig implements WebMvcConfigurer {
    @Autowired
    private UserTokenInceptor userTokenInceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userTokenInceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/css/**","/js/**","/img/**","/editor-md/**","/editor-md-upload/**","/login","/site/reset-pwd");
    }
    }

